package com.bank.backend.controller;

import com.bank.backend.annotation.AuthCheck;
import com.bank.backend.model.vo.DashboardStatsVO;
import com.bank.backend.result.Result;
import com.bank.backend.service.DashboardService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/admin/dashboard")
@Api(tags = "仪表盘管理")
@Slf4j
public class DashboardController {

    @Resource
    private DashboardService dashboardService;

    @GetMapping("/stats")
    @ApiOperation("获取仪表盘统计数据")
    @AuthCheck(mustRole = "管理员")
    public Result<DashboardStatsVO> getDashboardStats() {
        DashboardStatsVO stats = dashboardService.getStats();
        return Result.success(stats);
    }
} 